class CreateExams < ActiveRecord::Migration
  def self.up
    create_table :exams do |t|
      t.column "user_id", :int, :null => false
      t.column "theta", :float, :null => false, :default => 0.0
      t.column "skill_id", :int, :null => false
      t.column "exam_code", :string, :null => false
      t.column "irt_model", :string, :null => false, :limit=> 5, :default => '2PL'
      t.column "taken_at", :date, :null => false
      t.column "turn", :int, :null => false, :default => 1
      t.timestamps
    end
  end

  def self.down
    drop_table :exams
  end
end
